package com.tj.collection.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/21
 * Time: 上午11:47
 */
public enum TimeoutTypeEnum {
    WAIT_CALL_MOBILE(1, "电审联系不上重试"),
    WAIT_CALL_MOBILE_SECOND(2, "贷后回访");;

    private int type;
    private String desc;

    TimeoutTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public TimeoutTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TimeoutTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }


    public static TimeoutTypeEnum conventByType(int type) {
        TimeoutTypeEnum timeoutTypeEnum = null;
        for (TimeoutTypeEnum typeEnum : TimeoutTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                timeoutTypeEnum = typeEnum;
                break;
            }
        }

        return timeoutTypeEnum;
    }
}
